const homePage = resolve => { require(['@/pages/home'], resolve) }
const newsDetail = resolve => { require(['@/pages/news/newsDetail'], resolve) }
const rankingIndex = resolve => { require(['@/pages/ranking/rankingIndex'], resolve) }
const rankingDetail = resolve => { require(['@/pages/ranking/rankingDetail'], resolve) }
const orderIndex = resolve => { require(['@/pages/order/orderIndex'], resolve) }
const goodsPay = resolve => { require(['@/pages/order/pay'], resolve) }
const payState = resolve => { require(['@/pages/order/payState'], resolve) }
const queryStep1 = resolve => { require(['@/pages/queryCenter/queryStep1'], resolve) }
const queryStep2 = resolve => { require(['@/pages/queryCenter/queryStep2'], resolve) }
const queryStep3 = resolve => { require(['@/pages/queryCenter/queryStep3'], resolve) }
const queryStep4 = resolve => { require(['@/pages/queryCenter/queryStep4'], resolve) }
const mineIndex = resolve => { require(['@/pages/mine/mineIndex'], resolve) }
const mineUserInfo = resolve => { require(['@/pages/mine/userInfo'], resolve) }
const mineScoreRank = resolve => { require(['@/pages/mine/scoreRank'], resolve) }
const myrank = resolve => { require(['@/pages/mine/rank'], resolve) }
const login = resolve => { require(['@/pages/login/login'], resolve) }
const joinUs = resolve => { require(['@/pages/mine/joinUs'], resolve) }
const planQuery = resolve => { require(['@/pages/planQuery/planQuery'], resolve) }
const planResult = resolve => { require(['@/pages/planQuery/planResult'], resolve) }

let routes = [
  {
    path: '/',
    name: 'home',
    component: homePage,
    meta: {
      title: '金榜题名',
      hasTabbar: true,
      checkLogin: false
    }
  },
  // query
  {
    path: '/query/sp/1',
    name: 'queryStep1',
    component: queryStep1,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/query/sp/2',
    name: 'queryStep2',
    component: queryStep2,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/query/sp/3',
    name: 'queryStep3',
    component: queryStep3,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/query/sp/4',
    name: 'queryStep4',
    component: queryStep4,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: false
    }
  },
  // ranking
  {
    path: '/ranking',
    name: 'rankingIndex',
    component: rankingIndex,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/ranking/:id',
    name: 'rankingDetail',
    component: rankingDetail,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/news/detail/:id',
    name: 'newsDetail',
    component: newsDetail,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: false
    }
  },
  {
    path: '/order',
    name: 'orderIndex',
    component: orderIndex,
    meta: {
      title: '我的订单',
      hasTabbar: true,
      checkLogin: true
    }
  },
  {
    path: '/goods',
    name: 'goodsPay',
    component: goodsPay,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/paystate',
    name: 'payState',
    component: payState,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: false
    }
  },
  {
    path: '/mine',
    name: 'mineIndex',
    component: mineIndex,
    meta: {
      title: '我的',
      hasTabbar: true,
      checkLogin: true
    }
  },
  {
    path: '/mine/userinfo',
    name: 'mineUserInfo',
    component: mineUserInfo,
    meta: {
      title: '个人信息',
      hasTabbar: false,
      checkLogin: true
    }
  },
  // {
  //   path: '/mine/rank',
  //   name: 'scoreRank',
  //   component: mineScoreRank,
  //   meta: {
  //     title: '金榜题名',
  //     hasTabbar: false,
  //     checkLogin: true
  //   }
  // },
  {
    path: '/mine/rank',
    name: 'rank',
    component: myrank,
    meta: {
      title: '金榜题名',
      hasTabbar: false,
      checkLogin: true
    }
  },
  {
    path: '/login',
    name: 'login',
    component: login,
    meta: {
      title: '登录',
      hasTabbar: false,
      checkLogin: false
    }
  },
  {
    path: '/joinus',
    name: 'joinUs',
    component: joinUs,
    meta: {
      title: '加入我们',
      hasTabbar: true,
      checkLogin: false
    }
  },
  {
    path: '/service',
    name: 'service',
    component: resolve => { require(['@/pages/news/service'], resolve) },
    meta: {
      title: '金榜题名',
      hasTabbar: true,
      checkLogin: false
    }
  },
  {
    path: '/plan/query',
    name: 'planQuery',
    component: planQuery,
    meta: {
      title: '院校计划查询',
      hasTabbar: true,
      checkLogin: false
    }
  },
  {
    path: '/plan/result',
    name: 'planResult',
    component: planResult,
    meta: {
      title: '院校计划查询',
      hasTabbar: true,
      checkLogin: false
    }
  },
  {
    path: '/new/more',
    name: 'newMore',
    component: resolve => { require(['@/pages/news/more-news.vue'], resolve) },
    meta: {
      title: '院校计划查询',
      hasTabbar: true,
      checkLogin: false
    }
  },
  {
    path: '*',
    component: homePage
  }
]

export default routes
